﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

// 此脚本不再用了，更新写法了

public class BulletFireScript : MonoBehaviour {

	public float fireTime = .05f;

	void Start(){
	
		InvokeRepeating ("Fire", fireTime, fireTime);
	}

//	void Update () {
//		Instantiate (bullet, transform.position, Quaternion.identity);
//	}

	void Fire(){
		GameObject obj = NewObjectPoolerScript.current.GetPooledObject ();

		if (obj == null)	return;
			
		obj.transform.position = transform.position;
		obj.transform.rotation = transform.rotation;
		obj.SetActive (true);

	}
}
